tests/str: Rework sysinstall-tests to be an entrypoint
authorColin Walters <walters@verbum.org>
Thu, 22 Mar 2018 14:37:07 +0000 (10:37 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 22 Mar 2018 19:01:52 +0000 (19:01 +0000)
Prep for creating more types of tests.

Move copying of `tests/` into the sysinstall-tests rather than `overlay-git`
as not all test types may need that.

Factored out of https://github.com/ostreedev/ostree/pull/1501

Closes: #1509
Approved by: jlebon

.papr.yml
tests/fedora-str/overlay-git.yml
tests/fedora-str/sysinstall-tests.yml
tests/fedora-str/tests.yml [deleted file]

index bdb74ec9c64908aa3e95b0da832d2b939ba39654..501aeecff5db1ab87b89f604a69fa711bdd8e60b 100644 (file)
--- a/.papr.yml
+++ b/.papr.yml
@@ -15,7 +15,7 @@ tests:
   - ./tests/fedora-str/provision.sh
   # TODO: enhance papr to have caching, a bit like https://docs.travis-ci.com/user/caching/
   - curl -Lo fedora-atomic-host.qcow2 https://getfedora.org/atomic_qcow2_latest
-  - env "TEST_SUBJECTS=$(pwd)/fedora-atomic-host.qcow2" ./tests/fedora-str/playbook-run.sh tests/fedora-str/tests.yml
+  - env "TEST_SUBJECTS=$(pwd)/fedora-atomic-host.qcow2" ./tests/fedora-str/playbook-run.sh tests/fedora-str/sysinstall-tests.yml
 
 artifacts:
   - tests/fedora-str/artifacts/fedora-atomic-host.qcow2.log
index dc0623db8c49aed855eb383108230f6e958fec2b..65fe93793175e676084315af5fa2ad4b8dd4a570 100644 (file)
@@ -21,7 +21,3 @@
   when: ostree_orig_version_yaml['libostree']['Git'] == ostree_new_version_yaml['libostree']['Git']
   fail:
     msg: "Failed to change ostree version"
-
-# Next copy all of the tests/ directory
-- name: Copy test data
-  synchronize: src=../../ dest=/root/tests/ archive=yes
index 7990e1f7154955258ad7e544336ec89d9d36b3f5..88b289d43cc447e70952b1d44a85f056b9cbc7e7 100644 (file)
@@ -1,17 +1,28 @@
-# Run the system installed tests
-- import_tasks: overlay-git.yml
-  when: use_git_build
-# Down the line perhaps do each log file separately?
-- name: Run sysinstalled tests
-  shell: /root/tests/installed/run.sh &> /root/installed-tests.log
-  register: sysinstalled_result
-  failed_when: False
-- name: Fetch sysinstalled results
-  fetch:
-    src: /root/installed-tests.log
-    dest: artifacts/installed-tests.log
-    flat: yes
-- name: Assert that sysinstalled tests succeeded
-  when: sysinstalled_result.rc != 0
-  fail:
-    msg: "sysinstalled tests failed"
+# This entrypoint right now just runs the sysinstalled-tests.
+---
+- hosts: localhost
+  tags:
+  - atomic
+  remote_user: root
+  vars:
+    use_git_build: True
+  tasks:
+    - import_tasks: overlay-git.yml
+      when: use_git_build
+    # Next copy all of the tests/ directory
+    - name: Copy test data
+      synchronize: src=../../ dest=/root/tests/ archive=yes
+    # Down the line perhaps do each log file separately?
+    - name: Run shell script sysinstalled tests
+      shell: /root/tests/installed/run.sh &> /root/installed-tests.log
+      register: sysinstalled_result
+      failed_when: False
+    - name: Fetch sysinstalled results
+      fetch:
+        src: /root/installed-tests.log
+        dest: artifacts/installed-tests.log
+        flat: yes
+    - name: Assert that sysinstalled tests succeeded
+      when: sysinstalled_result.rc != 0
+      fail:
+        msg: "sysinstalled tests failed"
diff --git a/tests/fedora-str/tests.yml b/tests/fedora-str/tests.yml
deleted file mode 100644 (file)
index 0c60fd0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# This entrypoint right now just runs the sysinstalled-tests.
----
-- hosts: localhost
-  tags:
-  - atomic
-  remote_user: root
-  vars:
-    use_git_build: True
-  tasks:
-    - import_tasks: sysinstall-tests.yml